$(document).ready(function () {
  /* form init validation */
  var form = $("#coForm");

  // JQuery validate 插件看文档
  // form validation
  form.validate({
    rules: {
      no: {
        remote: baseUrl + "/check/no?oldNo=" + oldNo,
        alnum: true,
        maxlength: 4
      }
    },
    messages: {
      no: {
        remote: "该盘点单编号已被使用!"
      }
    }
  });




    $('.form_datetime').datetimepicker({
        format: 'yyyy-mm-dd',
        weekStart: 1,
        autoclose: true,
        startView: 2,
        minView: 2,
        forceParse: false,
        language: 'cn',
        calendarWeeks: true,
        pickerPosition: "bottom-left"
    }).on('changeDate', function (ev) {
        daycount = 0;
        if (null != ev.date && undefined != ev.date) {
            var day = new Date(ev.date.getYear(), ev.date.getMonth(),ev.date.getDate());
            daycount = day.getDate();
        }

    });

});
